<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/css/bootstrap.min.css" integrity="sha384-9aIt2nRpC12Uk9gS9baDl411NQApFmC26EwAOH8WgZl5MYYxFfc+NcPb1dKGj7Sk" crossorigin="anonymous">

    <script src="https://cdn.jsdelivr.net/npm/jquery@3.5.1/dist/jquery.slim.min.js" integrity="sha384-DfXdz2htPH0lsSSs5nCTpuj/zy4C+OGpamoFVy38MVBnE+IbbVYUew+OrCXaRkfj" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/popper.js@1.16.0/dist/umd/popper.min.js" integrity="sha384-Q6E9RHvbIyZFJoft+2mJbHaEWldlvI9IOYy5n3zV9zzTtmI3UksdQRVvoxMfooAo" crossorigin="anonymous"></script>
    <script src="https://cdn.jsdelivr.net/npm/bootstrap@4.5.0/dist/js/bootstrap.min.js" integrity="sha384-OgVRvuATP1z7JjHLkuOU7Xw704+h835Lr+6QL9UvYjZE3Ipu6Tp75j7Bh/kR0JKI" crossorigin="anonymous"></script>


</head>
<body>
<form action="" th:action="@{/order}" method="post">
    <table>
        <tr>
            <td>添加页面</td>
        </tr>
        <tr>
            <td>公司</td>
            <td>
                <select name="cid">
                    <option th:each="c:${companyinfoList}" th:value="${c.getCid()}" th:text="${c.getCname()}"></option>
                </select>
            </td>
        </tr>
        <tr>
            <td>类型</td>
            <td>
                <select name="tid">
                    <option th:each="t:${typeinfoList}" th:value="${t.getTid()}" th:text="${t.getTname()}"></option>
                </select>
            </td>
        </tr>
        <tr>
            <td>数量</td>
            <td>
                <input type="text" name="onumber">
                <span id="onumber"></span>
            </td>
        </tr>
        <tr>
            <td>备注</td>
            <td><textarea name="oremark" cols="20"></textarea></td>
        </tr>
        <tr>
            <td><input type="submit" value="提交"></td>
            <td><input type="reset" value="重置"></td>
        </tr>
    </table>
</form>
<script type="text/javascript" th:src="@{/jquery-3.2.1.slim.min.js}"
        src="../../static/asserts/js/jquery-3.2.1.slim.min.js"></script>
</body>
<script>
    $("input[type='submit']").click(function () {
        var num = $("input[name='onumber']").val();

        if (num == null || num == "" || time1 == null || time1 == "") {
            $("#onumber").html("不能为空哦！").css("color", "red");
            return false;
        } else {
            return true;
        }
    })
</script>
</html>